package com.glq1218.dashboard.controller;

import com.glq1218.domain.R;
import com.glq1218.user.service.UserService;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;
import java.util.Map;
import java.util.function.BiConsumer;
import java.util.stream.Collectors;

/**
 * @author glq1218
 * @description TODO
 * @since 2023/4/25 11:27
 */
@RestController
@RequestMapping("/api/dashboard")
@RequiredArgsConstructor
public class DashboardController {
    private final UserService userService;

    @GetMapping("/getUserData")
    public R<List<Map<String, Long>>> getUserData() {
        List<Map<String, Long>> userData = userService.getUserData();
        return R.ok(userData);
    }

    @GetMapping("/getUserAddData")
    public R<List<Map<String, Long>>> getUserAddData(){
        return R.ok(userService.getUserAddData());
    }
}
